package com.example.springbootlearn.netty.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * @Author：OBM
 * @DATE：2023/2/24 17:13
 */
@Component
@ConfigurationProperties(prefix = "yuyitech.netty")
@Data
public class NettyConfig {

    /**
     * 访问端口
     */
    private int port = 8897;

    private int bossThread = 0;

    private int workerThread = 0;

    private boolean keepalive;

    //当服务器请求处理线程全满时，用于临时存放已完成三次握手的请求的队列的最大长度
    private int backlog = 128;

    /**
     * socket访问地址
     */
    private String websocketPath = "/websocket";

    private long readerIdleTime = 0;

    private long writerIdleTime = 0;

    private long allIdleTime = 60;

    /**
     * 默认不开启ssl
     */
    private boolean ssl = false;

    private TimeUnit unit = TimeUnit.SECONDS;

}
